package com.zbkj.crmeb.enums;

/**
 * x
 *
 * @author muyu.myw
 * @date 2020/9/28 18:58
 */
public enum OrderTradeTypeEnum {
    CONSUME(1,"消费"),
    RECHARGE(2,"充值"),
    REFUND(3, "退款"),
    WITHDRAWAL(4, "提现"),
    SYSTEM_RECHARGE(5,"系统充值"),
    SYSTEM_REFUND(6, "系统扣除"),
    WITHDRAW_ACCOUNT(7, "转出到余额"),

    FREEZE_ACCOUNT_INCOME(8,"冻结金额收入"),
    FREEZE_ACCOUNT_SPEND(9,"冻结金额支出"),
    ACCOUNT_INCOME(10,"可用余额收入"),
    ACCOUNT_SPEND(11,"可用余额支出"),
    WITHDRAW_ACCOUNT_INCOME(12,"可提现余额收入"),
    WITHDRAW_ACCOUNT_SPEND(13,"可提现余额支出"),
    PROMOTION_AMOUNT_WITHDRAWAL(14,"推广金额提现"),
    
    ;
    Integer type;
    String typeName;

    public Integer getType() {
        return type;
    }

    public String getTypeName() {
        return typeName;
    }

    private OrderTradeTypeEnum(Integer type, String typeName){
        this.type = type;
        this.typeName = typeName;
    }
    public static OrderTradeTypeEnum getTypeByCode(Integer type){
        if(type != null){
            for(OrderTradeTypeEnum val : OrderTradeTypeEnum.values()){
                if(val.type.equals(type)){
                    return val;
                }
            }
        }
        return null;
    }
}
